<?php

namespace IDock\Insurance\LIHI\Request;

use IDock\Insurance\LIHI\Request\AllLIHIRequest;
use IDock\Insurance\LIHI\Response\EPolicyDownloadResponse;
use IDock\Visitor\EPolicyDownloadVisitor;

class EPolicyDownloadRequest extends AllLIHIRequest
{
    public $route = 'cp/getDZBDFiled';

    protected $response = EPolicyDownloadResponse::class;

    protected $urlTip = '下载电子保单';

    /**
     * @var  EPolicyDownloadVisitor $visitor
     */
    protected $visitor;

    public function generate(): array
    {
        $policy = $this->visitor->policyNo;
        $this->flowId = $this->visitor->argc['flowId'] ?? '';
        $arr = [
            'businessNo' => $policy,
            'appInsured' => '',
        ];
        if(isset($this->visitor->argc['printType'])){
            $arr['printType'] = 'bz';
        }
        return $arr;
    }
}
